<#include "/macro/utils.ftl">
<#if seasons??>
<#list seasons as season>
<div id="season${season_index}" class="displayorhide" style="display:<#if season_index==0>block<#else>none</#if>;">
	<div class="tv_sMenu">
		<strong>Season:</strong>
	    <ul>
	    	<#list seasons as se>
	    		<li <#if se_index==season_index>class="curr"</#if>><a href="javascript:" divId='season${se_index}'>${se.seasonNum}</a></li>
	    	</#list>
	     </ul>
	</div>
	<div class="tv_eCont">
	  <table width="100%" border="0" cellpadding="0" cellspacing="0">
	   	<tr>
	 		<th width="9%" bgcolor="#cccdce">Episodes</th>
	        <th width="42%" align="left" bgcolor="#cccdce">Title</th>
	        <th width="9%" bgcolor="#cccdce">Run Time</th>
	        <th width="10%" bgcolor="#cccdce">Air Data</th>
	        <th width="7%" bgcolor="#cccdce">Rating</th>
	        <th width="11%" bgcolor="#cccdce">Play</th>
	        <th width="12%" bgcolor="#cccdce">Download</th>
	   	</tr>
		<#assign eps = season.episodes>
		<#if eps?size != 0>
			<#list eps?reverse as ep>		
				<tr>
			        <td align="center">${ep.part}</td>
			        <td>${ep.episodeName}</td>
			        <td align="center"><@formatSeconds ep.duration /></td>
			        <td align="center">${(ep.airDate?date) ! ''}</td>
			        <td align="center">${ep.score}</td>
			        <td align="center"><a href="${contextPath}/tv/full-length/watch-${ep.id}" class="btn_p3">Play</a></td>
			        <td align="center"><a href="javascript:;" itemUrl="${ep.url!''}"  website="${ep.website}" itemTitle="${ep.episodeName!''}"  class="btn_d3 download_btn" >Download</a></td>
	    		</tr>
			</#list>
		</#if>
	  </table>
	</div>
</div>
</#list>
<#else>
	Not yet episode!
</#if>